package com.viknix.threadpool.manager.http.factory;

import com.viknix.threadpool.manager.http.config.HttpClientConfig;

/**
 * @Author: Dongqi
 * @Date: 2021/11/11 9:44
 * @Version 1.0
 * @Description: 默认 http 客户端工厂。
 */
public class DefaultHttpClientFactory extends AbstractHttpClientFactory {

    private static final int TIMEOUT = Integer.getInteger("tpm.http.timeout", 5000);

    @Override
    protected HttpClientConfig buildHttpClientConfig() {
        return HttpClientConfig.builder().setConTimeOutMillis(TIMEOUT).setReadTimeOutMillis(TIMEOUT >> 1).build();
    }
}
